
const fs = require("fs")
const path = require("path")

function getFile(name) {
    try {
        return fs.readFileSync(path.join(__dirname, "../", "/env", `/${name}.js`)) + "\r\n"
    } catch (error) {
        console.log(error.message, "读入文件错误");
        return ""
    }
}

function getCode() {

    return String.prototype.concat(
        "//env相关代码",
        getFile("EventTarget"),
        getFile("WindowProperties"),
        getFile("Window"),
        getFile("globalThis"),

    )

}


module.exports = { getCode, getFile }

